/*
This file is part of Arcadeflex.

Arcadeflex is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Arcadeflex is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Arcadeflex.  If not, see <http://www.gnu.org/licenses/>.
 */
/*
 * ported to v0.29
 * using automatic conversion tool v0.04
 * converted at : 22-10-2011 17:39:25
 *
 *
 * roms are from v0.36 romset
 * 
 * dkongjp requires changes to loading to work with 0.36romset
 * radarscp requires changes to loading to work with 0.36romset
 * dkjrjp requires changes to loading to work with 0.36romset
 * dkjrbl requires changes to loading to work with 0.36romset
 */ 
package drivers;

import static arcadeflex.libc.*;
import static arcadeflex.osdepend.*;
import static mame.commonH.*;
import static mame.cpuintrf.*;
import static mame.driverH.*;
import static mame.mame.*;
import static mame.osdependH.*;
import static sndhrdw.dkong.*;
import static vidhrdw.generic.*;
import static vidhrdw.dkong.*;
import static mame.inptport.*;
import static mame.memoryH.*;

public class dkong
{
			
	static MemoryReadAddress readmem[] =
	{
		new MemoryReadAddress( 0x0000, 0x5fff, MRA_ROM ),	/* DK: 0000-3fff */
		new MemoryReadAddress( 0x6000, 0x6fff, MRA_RAM ),	/* including sprites RAM */
		new MemoryReadAddress( 0x7400, 0x77ff, MRA_RAM ),	/* video RAM */
		new MemoryReadAddress( 0x7c00, 0x7c00, input_port_0_r ),	/* IN0 */
		new MemoryReadAddress( 0x7c80, 0x7c80, input_port_1_r ),	/* IN1 */
		new MemoryReadAddress( 0x7d00, 0x7d00, input_port_2_r ),	/* IN2/DSW2 */
		new MemoryReadAddress( 0x7d80, 0x7d80, input_port_3_r ),	/* DSW1 */
		new MemoryReadAddress( 0x8000, 0x9fff, MRA_ROM ),	/* DK3 and bootleg DKjr only */
		new MemoryReadAddress( -1 )	/* end of table */
	};
	
	static MemoryWriteAddress dkong_writemem[] =
	{
		new MemoryWriteAddress( 0x0000, 0x5fff, MWA_ROM ),
		new MemoryWriteAddress( 0x6000, 0x68ff, MWA_RAM ),
		new MemoryWriteAddress( 0x6900, 0x6a7f, MWA_RAM, spriteram, spriteram_size ),
		new MemoryWriteAddress( 0x6a80, 0x6fff, MWA_RAM ),
		new MemoryWriteAddress( 0x7400, 0x77ff, videoram_w, videoram, videoram_size ),
		new MemoryWriteAddress( 0x7800, 0x7803, MWA_RAM ),	/* ???? */
		new MemoryWriteAddress( 0x7808, 0x7808, MWA_RAM ),	/* ???? */
		new MemoryWriteAddress( 0x7c00, 0x7c00, dkong_sh2_w ),    	/* ???? */
		new MemoryWriteAddress( 0x7c80, 0x7c80, dkongjr_gfxbank_w ),
		new MemoryWriteAddress( 0x7d00, 0x7d07, dkong_sh1_w ),    /* ???? */
		new MemoryWriteAddress( 0x7d80, 0x7d80, dkong_sh3_w ),
		new MemoryWriteAddress( 0x7d81, 0x7d83, MWA_RAM ),	/* ???? */
		new MemoryWriteAddress( 0x7d84, 0x7d84, interrupt_enable_w ),
		new MemoryWriteAddress( 0x7d85, 0x7d85, MWA_RAM ),
		new MemoryWriteAddress( 0x7d86, 0x7d87, dkong_palettebank_w ),
		new MemoryWriteAddress( -1 )	/* end of table */
	};
	static MemoryWriteAddress dkongjr_writemem[] =
	{
		new MemoryWriteAddress( 0x0000, 0x5fff, MWA_ROM ),
		new MemoryWriteAddress( 0x6000, 0x68ff, MWA_RAM ),
		new MemoryWriteAddress( 0x6900, 0x6a7f, MWA_RAM, spriteram, spriteram_size ),
		new MemoryWriteAddress( 0x6a80, 0x6fff, MWA_RAM ),
		new MemoryWriteAddress( 0x7400, 0x77ff, videoram_w, videoram, videoram_size ),
		new MemoryWriteAddress( 0x7800, 0x7803, MWA_RAM ),	/* ???? */
		new MemoryWriteAddress( 0x7808, 0x7808, MWA_RAM ),	/* ???? */
		new MemoryWriteAddress( 0x7c00, 0x7c00, MWA_RAM ),	/* ???? */
		new MemoryWriteAddress( 0x7c80, 0x7c80, dkongjr_gfxbank_w ),
		new MemoryWriteAddress( 0x7d00, 0x7d07, MWA_RAM ),	/* ???? */
		new MemoryWriteAddress( 0x7d80, 0x7d83, MWA_RAM ),	/* ???? */
		new MemoryWriteAddress( 0x7d84, 0x7d84, interrupt_enable_w ),
		new MemoryWriteAddress( 0x7d85, 0x7d85, MWA_RAM ),
		new MemoryWriteAddress( 0x7d86, 0x7d87, dkong_palettebank_w ),
		new MemoryWriteAddress( 0x8000, 0x9fff, MWA_ROM ),	/* bootleg DKjr only */
		new MemoryWriteAddress( -1 )	/* end of table */
	};
	static MemoryWriteAddress dkong3_writemem[] =
	{
		new MemoryWriteAddress( 0x0000, 0x5fff, MWA_ROM ),
		new MemoryWriteAddress( 0x6000, 0x68ff, MWA_RAM ),
		new MemoryWriteAddress( 0x6900, 0x6a7f, MWA_RAM, spriteram, spriteram_size ),
		new MemoryWriteAddress( 0x6a80, 0x6fff, MWA_RAM ),
		new MemoryWriteAddress( 0x7400, 0x77ff, videoram_w, videoram, videoram_size ),
		new MemoryWriteAddress( 0x7e81, 0x7e81, dkong3_gfxbank_w ),
		new MemoryWriteAddress( 0x7e84, 0x7e84, interrupt_enable_w ),
		new MemoryWriteAddress( 0x7e86, 0x7e87, dkong_palettebank_w ),
		new MemoryWriteAddress( 0x8000, 0x9fff, MWA_ROM ),
		new MemoryWriteAddress( -1 )	/* end of table */
	};
	
	
	
	static InputPort input_ports[] =
	{
		new InputPort(	/* IN0 */
			0x00,
			new int[] { OSD_KEY_RIGHT, OSD_KEY_LEFT, OSD_KEY_UP, OSD_KEY_DOWN,
					OSD_KEY_LCONTROL, 0, 0, 0 } 
		),
		new InputPort(	/* IN1 */
			0x00,
			new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }
		),
		new InputPort(	/* IN2 */
			0x00,
			new int[] { OSD_KEY_F2, 0, OSD_KEY_1, OSD_KEY_2, 0, 0, 0, OSD_KEY_3 }
		),
		new InputPort(	/* DSW1 */
			0x84,
			new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }
		),
		new InputPort( -1 )	/* end of table */
	};
	
	static InputPort dkong3_input_ports[] =
	{
		new InputPort(	/* IN0 */
			0x00,
			new int[] { OSD_KEY_RIGHT, OSD_KEY_LEFT, OSD_KEY_UP, OSD_KEY_DOWN,
					OSD_KEY_LCONTROL, OSD_KEY_1, OSD_KEY_2, OSD_KEY_F1 }
		),
		new InputPort(	/* IN1 */
			0x00,
			new int[] { 0, 0, 0, 0, 0, OSD_KEY_3, 0, 0 }
		),
		new InputPort(	/* DSW2 */
			0x00,
			new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }
		),
		new InputPort(	/* DSW1 */
			0x00,
			new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }
		),
		new InputPort( -1 )	/* end of table */
	};
	
	static TrakPort trak_ports[] =
	{
	        new TrakPort( -1 )
	};
	
	static KEYSet keys[] =
	{
	        new KEYSet( 0, 2, "MOVE UP" ),
	        new KEYSet( 0, 1, "MOVE LEFT"  ),
	        new KEYSet( 0, 0, "MOVE RIGHT" ),
	        new KEYSet( 0, 3, "MOVE DOWN" ),
	        new KEYSet( 0, 4, "JUMP" ),
	        new KEYSet( -1 )
	};
	
	
	static DSW dsw[] =
	{
		new DSW( 3, 0x03, "LIVES", new String[] { "3", "4", "5", "6" } ),
		new DSW( 3, 0x0c, "BONUS", new String[] { "7000", "10000", "15000", "20000" } ),
		new DSW( -1 )
	};
	
	static DSW dkong3_dsw[] =
	{
		new DSW( 3, 0x03, "LIVES", new String[] { "3", "4", "5", "6" } ),
		new DSW( 3, 0x0c, "BONUS", new String[] { "30000", "40000", "50000", "NONE" } ),
		new DSW( 3, 0x30, "ADDITIONAL BONUS", new String[] { "30000", "40000", "50000", "NONE" } ),
		new DSW( 3, 0xc0, "DIFFICULTY", new String[] { "EASY", "MEDIUM", "HARD", "HARDEST" } ),
		new DSW( -1 )
	};
	
	
	static GfxLayout dkong_charlayout = new GfxLayout
	(
		8,8,	/* 8*8 characters */
		256,	/* 256 characters */
		2,	/* 2 bits per pixel */
		new int[] { 256*8*8, 0 },	/* the two bitplanes are separated */
		new int[] { 0, 1, 2, 3, 4, 5, 6, 7 },	/* pretty straightforward layout */
		new int[] { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
		8*8	/* every char takes 8 consecutive bytes */
	);
	static GfxLayout dkongjr_charlayout = new GfxLayout
	(
		8,8,	/* 8*8 characters */
		512,	/* 512 characters */
		2,	/* 2 bits per pixel */
		new int[] { 512*8*8, 0 },	/* the two bitplanes are separated */
		new int[] { 0, 1, 2, 3, 4, 5, 6, 7 },	/* pretty straightforward layout */
		new int[] { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
		8*8	/* every char takes 8 consecutive bytes */
	);
	static GfxLayout dkong_spritelayout = new GfxLayout
	(
		16,16,	/* 16*16 sprites */
		128,	/* 128 sprites */
		2,	/* 2 bits per pixel */
		new int[] { 128*16*16, 0 },	/* the two bitplanes are separated */
		new int[] { 0, 1, 2, 3, 4, 5, 6, 7,	/* the two halves of the sprite are separated */
				64*16*16+0, 64*16*16+1, 64*16*16+2, 64*16*16+3, 64*16*16+4, 64*16*16+5, 64*16*16+6, 64*16*16+7 },
		new int[] { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
				8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
		16*8	/* every sprite takes 16 consecutive bytes */
	);
	static GfxLayout dkong3_spritelayout = new GfxLayout
	(
		16,16,	/* 16*16 sprites */
		256,	/* 256 sprites */
		2,	/* 2 bits per pixel */
		new int[] { 256*16*16, 0 },	/* the two bitplanes are separated */
		new int[] { 0, 1, 2, 3, 4, 5, 6, 7,	/* the two halves of the sprite are separated */
				128*16*16+0, 128*16*16+1, 128*16*16+2, 128*16*16+3, 128*16*16+4, 128*16*16+5, 128*16*16+6, 128*16*16+7 },
		new int[] { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
				8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
		16*8	/* every sprite takes 16 consecutive bytes */
	);
	
	
	
	static GfxDecodeInfo dkong_gfxdecodeinfo[] =
	{
		new GfxDecodeInfo( 1, 0x0000, dkong_charlayout,   0, 64 ),
		new GfxDecodeInfo( 1, 0x1000, dkong_spritelayout, 0, 64 ),
		new GfxDecodeInfo( -1 ) /* end of array */
	};
	static GfxDecodeInfo dkongjr_gfxdecodeinfo[] =
	{
		new GfxDecodeInfo( 1, 0x0000, dkongjr_charlayout, 0, 64 ),
		new GfxDecodeInfo( 1, 0x2000, dkong_spritelayout, 0, 64 ),
		new GfxDecodeInfo( -1 ) /* end of array */
	};
	static GfxDecodeInfo dkong3_gfxdecodeinfo[] =
	{
		new GfxDecodeInfo( 1, 0x0000, dkongjr_charlayout,   0, 64 ),
		new GfxDecodeInfo( 1, 0x2000, dkong3_spritelayout,  0, 64 ),
		new GfxDecodeInfo( -1 ) /* end of array */
	};
	
	
	
	static char dkong_color_prom[] =
	{
		/* 2k - palette low 4 bits (inverted) */
		0xFF,0xFC,0xF0,0xFF,0xFF,0xFB,0xFF,0xF0,0xFF,0xFA,0xFF,0xFD,0xFF,0xFC,0xFF,0xF3,
		0xFF,0xF3,0xFB,0xFF,0xFF,0xF0,0xFD,0xF3,0xFF,0xFF,0xFC,0xF0,0xFF,0xFF,0xFA,0xF0,
		0xFF,0xFF,0xFA,0xF3,0xFF,0xF0,0xF3,0xF5,0xFF,0xFD,0xF0,0xF5,0xFF,0xFC,0xF3,0xFA,
		0xFF,0xF0,0xF0,0xFC,0xFF,0xFF,0xFB,0xF3,0xFF,0xFE,0xFA,0xFC,0xFF,0xFB,0xFF,0xFF,
		0xFF,0xFC,0xF0,0xFF,0xFF,0xFB,0xFF,0xF0,0xFF,0xFA,0xFF,0xFD,0xFF,0xF3,0xFA,0xF0,
		0xFF,0xF3,0xFA,0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0x0B,0x00,0x0F,0x03,0x0B,0x07,
		0x0F,0x0F,0x0B,0x00,0x0F,0x0C,0x07,0x00,0x0F,0x0F,0x07,0x00,0x0F,0x0C,0x07,0x00,
		0x0F,0x0C,0x0A,0x0F,0x0F,0x0C,0x0B,0x00,0x0F,0x0C,0x04,0x0B,0x0F,0x0C,0x04,0x0B,
		0x0F,0x0C,0x04,0x0B,0x0F,0x0C,0x04,0x0B,0x0F,0x0C,0x04,0x0B,0x0F,0x07,0x00,0x0A,
		0x0F,0x0F,0x0C,0x09,0x0F,0x07,0x03,0x0A,0x0F,0x0E,0x0B,0x00,0x0F,0x03,0x0B,0x07,
		0x0F,0x0F,0x0B,0x00,0x0F,0x0C,0x07,0x00,0x0F,0x0F,0x07,0x00,0x0F,0x04,0x07,0x00,
		0x0F,0x0C,0x0A,0x0F,0x0F,0x00,0x0B,0x00,0x0F,0x04,0x00,0x00,0x0F,0x04,0x00,0x00,
		0x0F,0x04,0x00,0x00,0x0F,0x04,0x00,0x00,0x0F,0x04,0x00,0x00,0x0F,0x07,0x00,0x0A,
		0x0F,0x0F,0x0C,0x09,0x0F,0x07,0x03,0x0A,0x0F,0x0E,0x0B,0x00,0x0F,0x03,0x0B,0x07,
		0x0F,0x0F,0x0B,0x00,0x0F,0x0C,0x00,0x00,0x0F,0x0F,0x07,0x00,0x0F,0x0C,0x07,0x00,
		/* 2f - palette high 4 bits (inverted) */
		0x0F,0x0F,0x00,0x01,0x0F,0x09,0x00,0x00,0x0F,0x0F,0x00,0x09,0x0F,0x0F,0x00,0x01,
		0x0F,0x0F,0x00,0x00,0x0F,0x0F,0x0C,0x00,0x0F,0x0F,0x0C,0x0E,0x0F,0x05,0x00,0x00,
		0x0F,0x01,0x09,0x00,0x0F,0x05,0x01,0x00,0x0F,0x0F,0x00,0x00,0x0F,0x01,0x0E,0x00,
		0x0F,0x01,0x0E,0x00,0x0F,0x0F,0x00,0x00,0x0F,0x01,0x00,0x00,0x0F,0x01,0x00,0x00,
		0x0F,0x0F,0x00,0x01,0x0F,0x09,0x00,0x00,0x0F,0x00,0x0E,0x00,0x0F,0x00,0x0E,0x00,
		0x0F,0x00,0x0E,0x00,0x0F,0x00,0x0E,0x00,0x0F,0x00,0x0E,0x00,0x0F,0x05,0x00,0x00,
		0x0F,0x01,0x09,0x00,0x0F,0x05,0x01,0x00,0x0F,0x0F,0x00,0x00,0x0F,0x01,0x0E,0x00,
		0x0F,0x01,0x0E,0x00,0x0F,0x0F,0x00,0x00,0x0F,0x01,0x00,0x00,0x0F,0x01,0x00,0x00,
		0x0F,0x0F,0x00,0x01,0x0F,0x0F,0x00,0x00,0x0F,0x0F,0x0C,0x00,0x0F,0x0F,0x0C,0x00,
		0x0F,0x0F,0x0C,0x00,0x0F,0x0F,0x0C,0x00,0x0F,0x0F,0x0C,0x00,0x0F,0x05,0x00,0x00,
		0x0F,0x01,0x09,0x00,0x0F,0x05,0x01,0x00,0x0F,0x0F,0x00,0x00,0x0F,0x01,0x0E,0x00,
		0x0F,0x01,0x0E,0x00,0x0F,0x0F,0x00,0x00,0x0F,0x01,0x00,0x00,0x0F,0x07,0x00,0x00,
		0x0F,0x0F,0x00,0x01,0x0F,0x09,0x00,0x00,0x0F,0x01,0x00,0x09,0x0F,0x01,0x00,0x09,
		0x0F,0x01,0x00,0x09,0x0F,0x01,0x00,0x09,0x0F,0x01,0x00,0x09,0x0F,0x05,0x00,0x00,
		0x0F,0x01,0x09,0x00,0x0F,0x05,0x01,0x00,0x0F,0x0F,0x00,0x00,0x0F,0x01,0x0E,0x00,
		0x0F,0x01,0x0E,0x00,0x0F,0x0F,0x0E,0x00,0x0F,0x01,0x00,0x00,0x0F,0x01,0x00,0x00,
		/* 2n - character color codes on a per-column basis */
		0x00,0x01,0x07,0x01,0x01,0x01,0x03,0x02,0x04,0x05,0x04,0x05,0x02,0x05,0x02,0x05,
		0x03,0x03,0x02,0x03,0x03,0x04,0x03,0x04,0x04,0x05,0x04,0x05,0x05,0x05,0x05,0x06,
		0x00,0x01,0x07,0x01,0x01,0x01,0x03,0x02,0x04,0x05,0x04,0x05,0x02,0x05,0x02,0x05,
		0x03,0x03,0x02,0x03,0x03,0x04,0x03,0x04,0x04,0x05,0x04,0x05,0x05,0x05,0x05,0x06,
		0x00,0x01,0x07,0x01,0x01,0x01,0x03,0x02,0x04,0x05,0x04,0x05,0x02,0x05,0x02,0x05,
		0x03,0x03,0x02,0x03,0x03,0x04,0x03,0x04,0x04,0x05,0x04,0x05,0x05,0x05,0x05,0x06,
		0x00,0x01,0x07,0x02,0x02,0x02,0x03,0x02,0x04,0x05,0x04,0x05,0x02,0x05,0x02,0x05,
		0x03,0x03,0x02,0x03,0x03,0x04,0x03,0x04,0x04,0x05,0x04,0x05,0x05,0x05,0x05,0x06,
		0x00,0x01,0x07,0x02,0x02,0x02,0x03,0x02,0x04,0x05,0x04,0x05,0x02,0x05,0x02,0x05,
		0x03,0x03,0x02,0x03,0x03,0x04,0x03,0x04,0x04,0x05,0x04,0x05,0x05,0x05,0x05,0x06,
		0x00,0x01,0x07,0x02,0x02,0x02,0x03,0x02,0x04,0x05,0x04,0x05,0x02,0x05,0x02,0x05,
		0x03,0x03,0x02,0x03,0x03,0x04,0x03,0x04,0x04,0x05,0x04,0x05,0x05,0x05,0x05,0x06,
		0x00,0x01,0x07,0x02,0x02,0x02,0x03,0x02,0x04,0x05,0x04,0x05,0x02,0x05,0x02,0x05,
		0x03,0x03,0x02,0x03,0x03,0x04,0x03,0x04,0x04,0x05,0x04,0x05,0x05,0x05,0x05,0x06,
		0x00,0x01,0x07,0x02,0x02,0x02,0x03,0x02,0x04,0x05,0x04,0x05,0x02,0x05,0x02,0x05,
		0x03,0x03,0x02,0x03,0x03,0x04,0x03,0x04,0x04,0x05,0x04,0x05,0x05,0x05,0x05,0x06
	};
	
	static char dkong3_color_prom[] =
	{
		/* 2fu - palette red component */
		0x00,0x0F,0x06,0x0F,0x00,0x00,0x0F,0x0F,0x00,0x08,0x0F,0x0F,0x00,0x08,0x08,0x08,
		0x00,0x08,0x0F,0x0E,0x00,0x00,0x00,0x0F,0x00,0x08,0x0F,0x08,0x00,0x0F,0x0F,0x00,
		0x00,0x06,0x0F,0x0F,0x00,0x04,0x01,0x0F,0x00,0x0F,0x0A,0x0F,0x00,0x0F,0x02,0x0F,
		0x00,0x00,0x00,0x0F,0x00,0x0F,0x0F,0x00,0x00,0x00,0x0F,0x0F,0x00,0x0F,0x06,0x0F,
		0x00,0x0F,0x06,0x0F,0x00,0x00,0x0F,0x0F,0x00,0x0C,0x0F,0x0F,0x00,0x0C,0x06,0x0D,
		0x00,0x0C,0x0B,0x01,0x00,0x00,0x00,0x0F,0x00,0x08,0x0F,0x08,0x00,0x0F,0x0F,0x00,
		0x00,0x06,0x0F,0x0F,0x00,0x04,0x01,0x0F,0x00,0x0F,0x0A,0x0F,0x00,0x0F,0x02,0x0F,
		0x00,0x00,0x00,0x0F,0x00,0x0F,0x0F,0x00,0x00,0x00,0x0F,0x0F,0x00,0x0F,0x06,0x0F,
		0x00,0x0F,0x06,0x0F,0x00,0x00,0x0F,0x0F,0x00,0x06,0x05,0x0F,0x00,0x0F,0x08,0x08,
		0x00,0x06,0x05,0x0F,0x00,0x00,0x00,0x0F,0x00,0x08,0x0F,0x08,0x00,0x0F,0x0F,0x00,
		0x00,0x06,0x0F,0x0F,0x00,0x04,0x01,0x0F,0x00,0x0F,0x0A,0x0F,0x00,0x0F,0x02,0x0F,
		0x00,0x00,0x00,0x0F,0x00,0x0F,0x0E,0x0F,0x00,0x00,0x0F,0x0F,0x00,0x0F,0x06,0x0F,
		0x00,0x0F,0x06,0x0F,0x00,0x00,0x0F,0x0F,0x00,0x0F,0x0F,0x0F,0x00,0x0F,0x0F,0x0F,
		0x00,0x0F,0x0F,0x0F,0x00,0x0F,0x0F,0x0F,0x00,0x08,0x0F,0x08,0x00,0x0F,0x0F,0x00,
		0x00,0x06,0x0F,0x0F,0x00,0x04,0x01,0x0F,0x00,0x0F,0x0A,0x0F,0x00,0x0F,0x02,0x0F,
		0x00,0x00,0x00,0x0F,0x00,0x0F,0x0F,0x00,0x00,0x00,0x0F,0x0F,0x00,0x0F,0x06,0x0F,
		/* 2e - palette green component */
		0x00,0x02,0x04,0x0F,0x00,0x02,0x08,0x0F,0x00,0x08,0x00,0x0F,0x00,0x08,0x0E,0x01,
		0x00,0x08,0x0F,0x08,0x00,0x00,0x00,0x0F,0x00,0x08,0x08,0x0A,0x00,0x00,0x06,0x00,
		0x00,0x00,0x02,0x0F,0x00,0x04,0x02,0x0F,0x00,0x00,0x00,0x03,0x00,0x0F,0x01,0x09,
		0x00,0x02,0x00,0x0F,0x00,0x0F,0x02,0x00,0x00,0x0F,0x00,0x0F,0x00,0x02,0x04,0x0C,
		0x00,0x02,0x04,0x0F,0x00,0x02,0x08,0x0F,0x00,0x0C,0x0E,0x0F,0x00,0x0C,0x00,0x00,
		0x00,0x0C,0x0B,0x02,0x00,0x00,0x00,0x0F,0x00,0x08,0x08,0x0A,0x00,0x00,0x06,0x00,
		0x00,0x00,0x02,0x0F,0x00,0x04,0x02,0x0F,0x00,0x00,0x00,0x03,0x00,0x0F,0x01,0x09,
		0x00,0x02,0x00,0x0F,0x00,0x0F,0x02,0x00,0x00,0x0F,0x00,0x0F,0x00,0x02,0x04,0x0C,
		0x00,0x02,0x04,0x0F,0x00,0x02,0x08,0x0F,0x00,0x0C,0x0D,0x0F,0x00,0x02,0x0E,0x01,
		0x00,0x0C,0x0D,0x0F,0x00,0x00,0x00,0x0F,0x00,0x08,0x08,0x0A,0x00,0x00,0x06,0x00,
		0x00,0x00,0x02,0x0F,0x00,0x04,0x02,0x0F,0x00,0x00,0x00,0x03,0x00,0x0F,0x01,0x09,
		0x00,0x02,0x00,0x0F,0x00,0x0F,0x0D,0x00,0x00,0x0F,0x00,0x0F,0x00,0x02,0x04,0x0C,
		0x00,0x02,0x04,0x0F,0x00,0x02,0x08,0x0F,0x00,0x00,0x0D,0x0F,0x00,0x00,0x0D,0x0F,
		0x00,0x00,0x0D,0x0F,0x00,0x00,0x0D,0x0F,0x00,0x08,0x08,0x0A,0x00,0x00,0x06,0x00,
		0x00,0x00,0x02,0x0F,0x00,0x04,0x02,0x0F,0x00,0x00,0x00,0x03,0x00,0x0F,0x01,0x09,
		0x00,0x02,0x00,0x0F,0x00,0x0F,0x02,0x00,0x00,0x0F,0x00,0x0F,0x00,0x02,0x04,0x0C,
		/* 2fl - palette blue component */
		0x00,0x05,0x00,0x0F,0x00,0x0F,0x03,0x0F,0x00,0x07,0x00,0x0F,0x00,0x07,0x03,0x03,
		0x00,0x07,0x0F,0x0F,0x00,0x09,0x04,0x0F,0x00,0x07,0x03,0x0F,0x00,0x00,0x00,0x06,
		0x00,0x00,0x03,0x0F,0x00,0x02,0x08,0x0F,0x00,0x00,0x00,0x00,0x00,0x0F,0x06,0x00,
		0x00,0x0F,0x05,0x0F,0x00,0x0F,0x00,0x0A,0x00,0x00,0x00,0x0F,0x00,0x05,0x00,0x02,
		0x00,0x05,0x00,0x0F,0x00,0x0F,0x03,0x0F,0x00,0x03,0x03,0x0F,0x00,0x03,0x00,0x00,
		0x00,0x03,0x0D,0x08,0x00,0x09,0x04,0x0F,0x00,0x07,0x03,0x0F,0x00,0x00,0x00,0x06,
		0x00,0x00,0x03,0x0F,0x00,0x02,0x08,0x0F,0x00,0x00,0x00,0x00,0x00,0x0F,0x06,0x00,
		0x00,0x0F,0x05,0x0F,0x00,0x0F,0x00,0x0A,0x00,0x00,0x00,0x0F,0x00,0x05,0x00,0x02,
		0x00,0x05,0x00,0x0F,0x00,0x0F,0x03,0x0F,0x00,0x00,0x00,0x04,0x00,0x00,0x03,0x03,
		0x00,0x00,0x00,0x04,0x00,0x09,0x04,0x0F,0x00,0x07,0x03,0x0F,0x00,0x00,0x00,0x06,
		0x00,0x00,0x03,0x0F,0x00,0x02,0x08,0x0F,0x00,0x00,0x00,0x00,0x00,0x0F,0x06,0x00,
		0x00,0x0F,0x05,0x0F,0x00,0x0F,0x07,0x00,0x00,0x00,0x00,0x0F,0x00,0x05,0x00,0x02,
		0x00,0x05,0x00,0x0F,0x00,0x0F,0x03,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,
		0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x07,0x03,0x0F,0x00,0x00,0x00,0x06,
		0x00,0x00,0x03,0x0F,0x00,0x02,0x08,0x0F,0x00,0x00,0x00,0x00,0x00,0x0F,0x06,0x00,
		0x00,0x0F,0x05,0x0F,0x00,0x0F,0x00,0x0A,0x00,0x00,0x00,0x0F,0x00,0x05,0x00,0x02,
		/* 2n - character color codes on a per-column basis */
		0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
		0x03,0x03,0x03,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x05,0x05,
		0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
		0x03,0x03,0x03,0x03,0x03,0x03,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x05,0x05,
		0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x03,0x03,0x03,
		0x03,0x03,0x03,0x03,0x03,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x05,0x05,
		0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
		0x02,0x02,0x02,0x02,0x02,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x05,0x05,
		0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
		0x02,0x02,0x02,0x02,0x02,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x05,0x05,
		0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x03,0x03,0x03,
		0x03,0x03,0x03,0x03,0x03,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x05,0x05,
		0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
		0x03,0x03,0x03,0x03,0x03,0x03,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x05,0x05,
		0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
		0x03,0x03,0x03,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x05,0x05
	};
	
	static char hunchy_color_prom[] =
	{
		/* 2e - palette low 4 bits (inverted) */
		0x0F,0x0F,0x0A,0x03,0x0F,0x03,0x0C,0x00,0x0F,0x06,0x0A,0x0C,0x0F,0x0F,0x0E,0x03,
		0x0F,0x0C,0x03,0x0F,0x0F,0x00,0x00,0x0C,0x0F,0x0F,0x0A,0x03,0x0F,0x00,0x0F,0x00,
		0x0F,0x0C,0x0F,0x03,0x0F,0x0F,0x0C,0x06,0x0F,0x00,0x0F,0x0E,0x0F,0x0C,0x0F,0x03,
		0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,
		0x0F,0x0F,0x0A,0x0C,0x0F,0x03,0x0C,0x00,0x0F,0x06,0x0A,0x0C,0x0F,0x0F,0x0E,0x0C,
		0x0F,0x0C,0x03,0x0C,0x0F,0x00,0x00,0x0C,0x0F,0x0F,0x0A,0x0C,0x0F,0x00,0x0F,0x0C,
		0x0F,0x0C,0x0F,0x03,0x0F,0x0F,0x0C,0x06,0x0F,0x00,0x0F,0x0E,0x0F,0x0C,0x0F,0x03,
		0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,
		0x0F,0x0F,0x0A,0x03,0x0F,0x03,0x0C,0x00,0x0F,0x06,0x0A,0x03,0x0F,0x0F,0x0E,0x03,
		0x0F,0x0C,0x03,0x03,0x0F,0x00,0x00,0x03,0x0F,0x0F,0x0A,0x03,0x0F,0x00,0x0F,0x03,
		0x0F,0x0C,0x0F,0x03,0x0F,0x0F,0x0C,0x06,0x0F,0x00,0x0F,0x0E,0x0F,0x0C,0x0F,0x03,
		0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,
		0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,
		0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,
		0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,
		0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,
		/* 2f - palette high 4 bits (inverted) */
		0x0F,0x01,0x04,0x00,0x0F,0x0E,0x01,0x00,0x0F,0x00,0x03,0x01,0x0F,0x01,0x0F,0x0E,
		0x0F,0x0F,0x0E,0x01,0x0F,0x00,0x00,0x0F,0x0F,0x01,0x04,0x00,0x0F,0x00,0x01,0x0E,
		0x0F,0x01,0x01,0x0E,0x0F,0x01,0x01,0x00,0x0F,0x00,0x01,0x04,0x0F,0x01,0x01,0x0E,
		0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,
		0x0F,0x01,0x04,0x01,0x0F,0x0E,0x01,0x00,0x0F,0x00,0x03,0x01,0x0F,0x01,0x0F,0x01,
		0x0F,0x0F,0x0E,0x01,0x0F,0x00,0x00,0x01,0x0F,0x01,0x04,0x01,0x0F,0x00,0x01,0x01,
		0x0F,0x01,0x01,0x0E,0x0F,0x01,0x01,0x00,0x0F,0x00,0x01,0x04,0x0F,0x01,0x01,0x0E,
		0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,
		0x0F,0x01,0x04,0x0E,0x0F,0x0E,0x01,0x00,0x0F,0x00,0x03,0x0E,0x0F,0x01,0x0F,0x0E,
		0x0F,0x0F,0x0E,0x0E,0x0F,0x00,0x00,0x0E,0x0F,0x01,0x04,0x0E,0x0F,0x00,0x01,0x0E,
		0x0F,0x01,0x01,0x0E,0x0F,0x01,0x01,0x00,0x0F,0x00,0x01,0x04,0x0F,0x01,0x01,0x0E,
		0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,
		0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,
		0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,
		0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,
		0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,
		/* 2n - character color codes on a per-column basis */
		0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x03,0x03,0x04,0x04,0x05,0x05,0x06,0x06,0x06,
		0x07,0x07,0x07,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
		0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x03,0x03,0x04,0x04,0x05,0x05,0x06,0x06,0x06,
		0x07,0x07,0x07,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
		0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x03,0x03,0x04,0x04,0x05,0x05,0x06,0x06,0x06,
		0x07,0x07,0x07,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
		0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x03,0x03,0x04,0x04,0x05,0x05,0x06,0x06,0x06,
		0x07,0x07,0x07,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
		0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x03,0x03,0x04,0x04,0x05,0x05,0x06,0x06,0x06,
		0x07,0x07,0x07,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
		0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x03,0x03,0x04,0x04,0x05,0x05,0x06,0x06,0x06,
		0x07,0x07,0x07,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
		0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x03,0x03,0x04,0x04,0x05,0x05,0x06,0x06,0x06,
		0x07,0x07,0x07,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
		0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x03,0x03,0x04,0x04,0x05,0x05,0x06,0x06,0x06,
		0x07,0x07,0x07,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01
	};
	
	
	
	static MachineDriver dkong_machine_driver = new MachineDriver
	(
		/* basic machine hardware */
		new MachineCPU[] {
			new MachineCPU(
				CPU_Z80,
				3072000,	/* 3.072 Mhz (?) */
				0,
				readmem,dkong_writemem,null,null,
				nmi_interrupt,1
			)
		},
		60,
		10,	/* 10 CPU slices per frame - enough for the sound CPU to read all commands */
		null,
	
		/* video hardware */
		32*8, 32*8, new rectangle( 0*8, 32*8-1, 2*8, 30*8-1 ),
		dkong_gfxdecodeinfo,
		256, 64*4,
		dkong_vh_convert_color_prom,
	
		VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY,
		null,
		dkong_vh_start,
		generic_vh_stop,
		dkong_vh_screenrefresh,
	
		/* sound hardware */
		null,
		null,
		null,
		null,
		dkong_sh_update
	);
	
	static MachineDriver dkongjr_machine_driver = new MachineDriver
	(
		/* basic machine hardware */
		new MachineCPU[] {
			new MachineCPU(
				CPU_Z80,
				3072000,	/* 3.072 Mhz (?) */
				0,
				readmem,dkongjr_writemem,null,null,
				nmi_interrupt,1
			)
		},
		60,
		10,	/* 10 CPU slices per frame - enough for the sound CPU to read all commands */
		null,
	
		/* video hardware */
		32*8, 32*8, new rectangle( 0*8, 32*8-1, 2*8, 30*8-1 ),
		dkongjr_gfxdecodeinfo,
		256, 64*4,
		dkong_vh_convert_color_prom,
	
		VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY,
		null,
		dkong_vh_start,
		generic_vh_stop,
		dkong_vh_screenrefresh,
	
		/* sound hardware */
		null,
		null,
		null,
		null,
		null
	);
	
	static MachineDriver dkong3_machine_driver = new MachineDriver
	(
		/* basic machine hardware */
		new MachineCPU[] {
			new MachineCPU(
				CPU_Z80,
				4000000,	/* 4 Mhz ? */
				0,
				readmem,dkong3_writemem,null,null,
				nmi_interrupt,1
			)
		},
		60,
		10,	/* 10 CPU slices per frame - enough for the sound CPU to read all commands */
		null,
	
		/* video hardware */
		32*8, 32*8, new rectangle( 0*8, 32*8-1, 2*8, 30*8-1 ),
		dkong3_gfxdecodeinfo,
		256, 64*4,
		dkong3_vh_convert_color_prom,
	
		VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY,
		null,
		dkong_vh_start,
		generic_vh_stop,
		dkong_vh_screenrefresh,
	
		/* sound hardware */
		null,
		null,
		null,
		null,
		null
	);
	
	
	
	/***************************************************************************
	
	  Game driver(s)
	
	***************************************************************************/
	
	static RomLoadPtr dkong_rom = new RomLoadPtr(){ public void handler(){ 
		ROM_REGION(0x10000);/* 64k for code */
		ROM_LOAD( "dk.5e",  0x0000, 0x1000, 0xa0bfe0f7 );
		ROM_LOAD( "dk.5c",  0x1000, 0x1000, 0x36320606 );
		ROM_LOAD( "dk.5b",  0x2000, 0x1000, 0x57b81038 );
		ROM_LOAD( "dk.5a",  0x3000, 0x1000, 0xe2f03e46 );
		/* space for diagnostic ROM */
	
		ROM_REGION(0x3000);/* temporary space for graphics (disposed after conversion) */
		ROM_LOAD( "dk.3n",  0x0000, 0x0800, 0x5947fc8f );
		ROM_LOAD( "dk.3p",  0x0800, 0x0800, 0xcf971207 );
		ROM_LOAD( "dk.7c",  0x1000, 0x0800, 0xeca7e655 );
		ROM_LOAD( "dk.7d",  0x1800, 0x0800, 0xd8700f2a );
		ROM_LOAD( "dk.7e",  0x2000, 0x0800, 0x3dd5410b );
		ROM_LOAD( "dk.7f",  0x2800, 0x0800, 0xcc1d7c97 );
	
		ROM_REGION(0x1000);/* sound */
		ROM_LOAD( "dk.3h",  0x0000, 0x0800, 0x52574a61 );
		ROM_LOAD( "dk.3f",  0x0800, 0x0800, 0x2a6cd3fa );
	ROM_END(); }}; 
	
	static RomLoadPtr dkongjp_rom = new RomLoadPtr(){ public void handler(){ 
            ROM_REGION(0x10000);	/* 64k for code */
                ROM_LOAD( "5f.cpu",  0x0000, 0x1000, 0x949b12d3 );
                ROM_LOAD( "5g.cpu",  0x1000, 0x1000, 0xf81386e7 );
                ROM_LOAD( "5h.cpu",  0x2000, 0x1000, 0x45b7e62b );
                ROM_LOAD( "5k.cpu",  0x3000, 0x1000, 0x97dd25c5 );

                ROM_REGION(0x3000);	/* temporary space for graphics (disposed after conversion) */
                ROM_LOAD( "dk.3n",        0x0000, 0x0800, 0x12c8c95d );
                ROM_LOAD( "5k.vid",       0x0800, 0x0800, 0x3684f914 );
                ROM_LOAD( "dk.7c",        0x1000, 0x0800, 0x59f8054d );
                ROM_LOAD( "dk.7d",        0x1800, 0x0800, 0x672e4714 );
                ROM_LOAD( "dk.7e",        0x2000, 0x0800, 0xfeaa59ee );
                ROM_LOAD( "dk.7f",        0x2800, 0x0800, 0x20f2ef7e );

                ROM_REGION(0x1000);	/* sound */
                ROM_LOAD( "dk.3h",        0x0000, 0x0800, 0x45a4ed06 );
                ROM_LOAD( "dk.3f",        0x0800, 0x0800, 0x4743fe92 );
	ROM_END(); }}; 
	
	static RomLoadPtr radarscp_rom = new RomLoadPtr(){ public void handler(){ 
		ROM_REGION(0x10000);/* 64k for code */
		ROM_LOAD( "trs2c5fc",     0x0000, 0x1000, 0x40949e0d ); 
                ROM_LOAD( "trs2c5gc",     0x1000, 0x1000, 0xafa8c49f );
                ROM_LOAD( "trs2c5hc",     0x2000, 0x1000, 0x51b8263d );
                ROM_LOAD( "trs2c5kc",     0x3000, 0x1000, 0x1f0101f7 );
		/* space for diagnostic ROM */
	
		ROM_REGION(0x3000);/* temporary space for graphics (disposed after conversion) */
                ROM_LOAD( "trs2v3gc",     0x0000, 0x0800, 0xf095330e );
                ROM_LOAD( "trs2v3hc",     0x0800, 0x0800, 0x15a316f0 );
                ROM_LOAD( "trs2v3dc",     0x1000, 0x0800, 0xe0bb0db9 );
                ROM_LOAD( "trs2v3cc",     0x1800, 0x0800, 0x6c4e7dad );
                ROM_LOAD( "trs2v3bc",     0x2000, 0x0800, 0x6fdd63f1 );
                ROM_LOAD( "trs2v3ac",     0x2800, 0x0800, 0xbbf62755 );

		ROM_REGION(0x1000);/* sound */
		ROM_LOAD( "trs2s3i",      0x0000, 0x0800, 0x78034f14 );
	ROM_END(); }}; 
	
	static RomLoadPtr dkongjr_rom = new RomLoadPtr(){ public void handler(){ 
		ROM_REGION(0x10000);/* 64k for code */
		ROM_LOAD( "dkj.5b",  0x0000, 0x1000, 0x831d73dd );
		ROM_CONTINUE(        0x3000, 0x1000 );
		ROM_LOAD( "dkj.5c",  0x2000, 0x0800, 0xe0078007 );
		ROM_CONTINUE(        0x4800, 0x0800 );
		ROM_CONTINUE(        0x1000, 0x0800 );
		ROM_CONTINUE(        0x5800, 0x0800 );
		ROM_LOAD( "dkj.5e",  0x4000, 0x0800, 0xb31be9f1 );
		ROM_CONTINUE(        0x2800, 0x0800 );
		ROM_CONTINUE(        0x5000, 0x0800 );
		ROM_CONTINUE(        0x1800, 0x0800 );
	
		ROM_REGION(0x4000);/* temporary space for graphics (disposed after conversion) */
		ROM_LOAD( "dkj.3n",  0x0000, 0x1000, 0x4c96d5b0 );
		ROM_LOAD( "dkj.3p",  0x1000, 0x1000, 0xfbaafe4a );
		ROM_LOAD( "dkj.7c",  0x2000, 0x0800, 0x9ecd901b );
		ROM_LOAD( "dkj.7d",  0x2800, 0x0800, 0xac9378bb );
		ROM_LOAD( "dkj.7e",  0x3000, 0x0800, 0x9785a0b9 );
		ROM_LOAD( "dkj.7f",  0x3800, 0x0800, 0xecc39067 );
	
		ROM_REGION(0x1000);/* sound? */
		ROM_LOAD( "dkj.3h",  0x0000, 0x1000, 0x65e71f9f );
	ROM_END(); }}; 
	
	static RomLoadPtr dkjrjp_rom = new RomLoadPtr(){ public void handler(){ 
		ROM_REGION(0x10000);/* 64k for code */
		ROM_LOAD( "dkjp.5b",  0x0000, 0x1000, 0x558d63db );
		ROM_CONTINUE(        0x3000, 0x1000 );
		ROM_LOAD( "dkjp.5c",  0x2000, 0x0800, 0xf8096601 );
		ROM_CONTINUE(        0x4800, 0x0800 );
		ROM_CONTINUE(        0x1000, 0x0800 );
		ROM_CONTINUE(        0x5800, 0x0800 );
		ROM_LOAD( "dkjp.5e",  0x4000, 0x0800, 0xb319e9f7 );
		ROM_CONTINUE(        0x2800, 0x0800 );
		ROM_CONTINUE(        0x5000, 0x0800 );
		ROM_CONTINUE(        0x1800, 0x0800 );
	
		ROM_REGION(0x4000);/* temporary space for graphics (disposed after conversion) */
		ROM_LOAD( "dkj.3n",  0x0000, 0x1000, 0x4c96d5b0 );
		ROM_LOAD( "dkj.3p",  0x1000, 0x1000, 0xfbaafe4a );
		ROM_LOAD( "dkj.7c",  0x2000, 0x0800, 0x9ecd901b );
		ROM_LOAD( "dkj.7d",  0x2800, 0x0800, 0xac9378bb );
		ROM_LOAD( "dkj.7e",  0x3000, 0x0800, 0x9785a0b9 );
		ROM_LOAD( "dkj.7f",  0x3800, 0x0800, 0xecc39067 );
	
		ROM_REGION(0x1000);/* sound? */
		ROM_LOAD( "dkj.3h",  0x0000, 0x1000, 0x65e71f9f );
	ROM_END(); }}; 
	
	static RomLoadPtr dkjrbl_rom = new RomLoadPtr(){ public void handler(){ 
		ROM_REGION(0x10000);/* 64k for code */
		ROM_LOAD( "djr1-c.5b", 0x0000, 0x1000, 0xe453ca6f );
		ROM_CONTINUE(          0x3000, 0x1000 );
		ROM_LOAD( "djr1-c.5c", 0x2000, 0x0800, 0x22b438b8 );
		ROM_CONTINUE(          0x4800, 0x0800 );
		ROM_CONTINUE(          0x1000, 0x0800 );
		ROM_CONTINUE(          0x5800, 0x0800 );
		ROM_LOAD( "djr1-c.5e", 0x4000, 0x0800, 0x91018b3b );
		ROM_CONTINUE(          0x2800, 0x0800 );
		ROM_CONTINUE(          0x5000, 0x0800 );
		ROM_CONTINUE(          0x1800, 0x0800 );
		ROM_LOAD( "djr1-c.5a", 0x8000, 0x1000, 0x594ff833 );
	
		ROM_REGION(0x4000);/* temporary space for graphics (disposed after conversion) */
		ROM_LOAD( "dkj.3n",  0x0000, 0x1000, 0x4c96d5b0 );
		ROM_LOAD( "dkj.3p",  0x1000, 0x1000, 0xfbaafe4a );
		ROM_LOAD( "dkj.7c",  0x2000, 0x0800, 0x9ecd901b );
		ROM_LOAD( "dkj.7d",  0x2800, 0x0800, 0xac9378bb );
		ROM_LOAD( "dkj.7e",  0x3000, 0x0800, 0x9785a0b9 );
		ROM_LOAD( "dkj.7f",  0x3800, 0x0800, 0xecc39067 );
	
		ROM_REGION(0x1000);/* sound? */
		ROM_LOAD( "dkj.3h",  0x0000, 0x1000, 0x65e71f9f );
	ROM_END(); }}; 
	
	static RomLoadPtr dkong3_rom = new RomLoadPtr(){ public void handler(){ 
		ROM_REGION(0x10000);/* 64k for code */
		ROM_LOAD( "dk3c.7b", 0x0000, 0x2000, 0x1f48b2d8 );
		ROM_LOAD( "dk3c.7c", 0x2000, 0x2000, 0x02129a26 );
		ROM_LOAD( "dk3c.7d", 0x4000, 0x2000, 0xf6ac38f8 );
		ROM_LOAD( "dk3c.7e", 0x8000, 0x2000, 0x9aa51d95 );
	
		ROM_REGION(0x6000);/* temporary space for graphics (disposed after conversion) */
		ROM_LOAD( "dk3v.3n", 0x0000, 0x1000, 0xce64f6d0 );
		ROM_LOAD( "dk3v.3p", 0x1000, 0x1000, 0x06537143 );
		ROM_LOAD( "dk3v.7c", 0x2000, 0x1000, 0xfdc2c044 );
		ROM_LOAD( "dk3v.7d", 0x3000, 0x1000, 0x79ed16db );
		ROM_LOAD( "dk3v.7e", 0x4000, 0x1000, 0x233a64e8 );
		ROM_LOAD( "dk3v.7f", 0x5000, 0x1000, 0x4381b33d );
	
		ROM_REGION(0x4000);/* sound */
		ROM_LOAD( "dk3c.5l", 0x0000, 0x2000, 0x34813d8d );
		ROM_LOAD( "dk3c.6h", 0x2000, 0x2000, 0xe2c9caa7 );
	ROM_END(); }}; 
	
	static RomLoadPtr hunchy_rom = new RomLoadPtr(){ public void handler(){ 
		ROM_REGION(0x10000);    /* 64k for code */
		/* the following is all wrong. Hunchback runs on a modified Donkey */
		/* Kong Jr. board, but with a twist. Here is how Tim Lindquist describes it: */
		/* Hunchback is a hack of a DKjr boardset. The only major difference that I */
		/* see is a new daughterboard in a CPU socket. It's got a big chip labeled  */
		/* MAB2650A CRG3243MOY. Perhap's that's a pin-scrambled 6502? */
		/* (2650/6502???... maybe a clue as to how its scrambled ;-) ). The db also */
		/* has various 74LS chips and a couple proms (soldered), and a VERY strange */
		/* looking flat chip. */
		ROM_LOAD( "1b.bin", 0x0000, 0x1000, 0xedc7328b );
		ROM_LOAD( "2a.bin", 0x1000, 0x1000, 0x07a951d3 );
		ROM_LOAD( "3a.bin", 0x2000, 0x1000, 0x84d6fc0e );
		ROM_LOAD( "4c.bin", 0x3000, 0x1000, 0xe2a39fbd );
		ROM_LOAD( "5a.bin", 0x4000, 0x1000, 0x2f46d302 );
		ROM_LOAD( "6c.bin", 0x5000, 0x1000, 0x8d6b2637 );
		ROM_LOAD( "8a.bin", 0x8000, 0x0800, 0x7afe3b86 );
	
		ROM_REGION(0x4000);     /* temporary space for graphics (disposed after conversion) */
		ROM_LOAD( "11a.bin", 0x0000, 0x0800, 0xf5280414 );
		ROM_LOAD( "9b.bin",  0x0800, 0x0800, 0x015ee94c );
		/* 1000-17ff empty */
		ROM_LOAD( "10b.bin", 0x1800, 0x0800, 0x72d82f86 );
		/* 2000-3fff empty */
	
		ROM_REGION(0x10000);    /* 64k for the audio CPU */
		ROM_LOAD( "5b_snd.bin", 0x0000, 0x0800, 0xd71b1c53 );
	ROM_END(); }}; 
	
	
	
	static String sample_names[] =
	{
		"effect00.sam",
		"effect01.sam",
		"effect02.sam",
		"effect03.sam",
		"effect04.sam",
		"effect05.sam",
		"effect06.sam",
		"effect07.sam",
		"tune00.sam",
		"tune01.sam",
		"tune02.sam",
		"tune03.sam",
		"tune04.sam",
		"tune05.sam",
		"tune06.sam",
		"tune07.sam",
		"tune08.sam",
		"tune09.sam",
		"tune0a.sam",
		"tune0b.sam",
		"tune0c.sam",
		"tune0d.sam",
		"tune0e.sam",
		"tune0f.sam",
		"interupt.sam",
	    null	/* end of array */
	};
	
	
	
	static HiscoreLoadPtr hiload = new HiscoreLoadPtr() { public int handler() 
	{
		/* check if the hi score table has already been initialized */
		if (memcmp(RAM, 0x611d, new char[] { 0x50,0x76,0x00 }, 3) == 0 &&
				memcmp(RAM, 0x61a5, new char[] { 0x00,0x43,0x00 }, 3) == 0 &&
				memcmp(RAM, 0x60b8, new char[] { 0x50,0x76,0x00 }, 3) == 0)	/* high score */
		{
			FILE f;
	
	
			if ((f = osd_fopen(Machine.gamedrv.name,null,OSD_FILETYPE_HIGHSCORE,0)) != null)
			{
				osd_fread(f,RAM, 0x6100,34*5);
				RAM[0x60b8] = RAM[0x611d];
				RAM[0x60b9] = RAM[0x611e];
				RAM[0x60ba] = RAM[0x611f];
				/* also copy the high score to the screen, otherwise it won't be */
				/* updated until a new game is started */
				videoram_w.handler(0x0221,RAM[0x6108]);
				videoram_w.handler(0x0201,RAM[0x6109]);
				videoram_w.handler(0x01e1,RAM[0x610a]);
				videoram_w.handler(0x01c1,RAM[0x610b]);
				videoram_w.handler(0x01a1,RAM[0x610c]);
				osd_fclose(f);
			}
	
			return 1;
		}
		else return 0;	/* we can't load the hi scores yet */
	} };
	
	
	
	static HiscoreSavePtr hisave = new HiscoreSavePtr() { public void handler() 
	{
		FILE f;
	
	
		if ((f = osd_fopen(Machine.gamedrv.name,null,OSD_FILETYPE_HIGHSCORE,1)) != null)
		{
			osd_fwrite(f,RAM, 0x6100,34*5);
			osd_fclose(f);
		}
	} };
	
	
	
	static HiscoreLoadPtr dkong3_hiload = new HiscoreLoadPtr() { public int handler() 
	{
		/* check if the hi score table has already been initialized */
		if (memcmp(RAM, 0x6b1d, new char[] { 0x00,0x20,0x01  }, 3) == 0 &&
				memcmp(RAM, 0x6ba5, new char[] { 0x00,0x32,0x00 }, 3) == 0)
		{
			FILE f;
	
	
			if ((f = osd_fopen(Machine.gamedrv.name,null,OSD_FILETYPE_HIGHSCORE,0)) != null)
			{
				osd_fread(f,RAM, 0x6b00,34*5);	/* hi scores */
				RAM[0x68f3] = RAM[0x6b1f];
				RAM[0x68f4] = RAM[0x6b1e];
				RAM[0x68f5] = RAM[0x6b1d];
				osd_fread(f,RAM, 0x6c20,0x40);	/* distributions */
				osd_fread(f,RAM, 0x6c16,4);
				osd_fclose(f);
			}
	
			return 1;
		}
		else return 0;	/* we can't load the hi scores yet */
	} };
	
	
	
	static HiscoreSavePtr dkong3_hisave = new HiscoreSavePtr() { public void handler() 
	{
		FILE f;
	
	
		if ((f = osd_fopen(Machine.gamedrv.name,null,OSD_FILETYPE_HIGHSCORE,1)) != null)
		{
			osd_fwrite(f,RAM, 0x6b00,34*5);	/* hi scores */
			osd_fwrite(f,RAM, 0x6c20,0x40);	/* distribution */
			osd_fwrite(f,RAM, 0x6c16,4);
			osd_fclose(f);
		}
	} };
	
	
	
	public static GameDriver dkong_driver = new GameDriver
	(
		"Donkey Kong (US version)",
		"dkong",
		"Gary Shepherdson (Kong emulator)\nBrad Thomas (hardware info)\nEdward Massey (MageX emulator)\nNicola Salmoria (MAME driver)\nRon Fries (sound)\nGary Walton (color info)\nSimon Walls (color info)",
		dkong_machine_driver,
	
		dkong_rom,
		null, null,
		sample_names,
	
		input_ports, null, trak_ports, dsw, keys,
	
		dkong_color_prom, null, null,
		ORIENTATION_ROTATE_90,
	
		hiload, hisave
	);
	
	public static GameDriver dkongjp_driver = new GameDriver
	(
		"Donkey Kong (Japanese version)",
		"dkongjp",
		"Gary Shepherdson (Kong emulator)\nBrad Thomas (hardware info)\nEdward Massey (MageX emulator)\nNicola Salmoria (MAME driver)\nRon Fries (sound)\nGary Walton (color info)\nSimon Walls (color info)",
		dkong_machine_driver,
	
		dkongjp_rom,
		null, null,
		sample_names,
	
		input_ports, null, trak_ports, dsw, keys,
	
		dkong_color_prom, null, null,
		ORIENTATION_ROTATE_90,
	
		hiload, hisave
	);
	
	public static GameDriver radarscp_driver = new GameDriver
	(
		"Radarscope",
		"radarscp",
		"Gary Shepherdson (Kong emulator)\nBrad Thomas (hardware info)\nEdward Massey (MageX emulator)\nNicola Salmoria (MAME driver)",
		dkong_machine_driver,
	
		radarscp_rom,
		null, null,
		null,
	
		input_ports, null, trak_ports, dsw, keys,
	
		dkong_color_prom, null, null,
		ORIENTATION_ROTATE_90,
	
		null, null
	);
	
	public static GameDriver dkongjr_driver = new GameDriver
	(
		"Donkey Kong Jr. (US)",
		"dkongjr",
		"Gary Shepherdson (Kong emulator)\nBrad Thomas (hardware info)\nNicola Salmoria (MAME driver)\nTim Lindquist (color info)",
		dkongjr_machine_driver,
	
		dkongjr_rom,
		null, null,
		null,
	
		input_ports, null, trak_ports, dsw, keys,
	
		dkongjr_color_prom, null, null,
		ORIENTATION_ROTATE_90,
	
		hiload, hisave
	);
	
	public static GameDriver dkjrjp_driver = new GameDriver
	(
		"Donkey Kong Jr. (Japanese)",
		"dkjrjp",
		"Gary Shepherdson (Kong emulator)\nBrad Thomas (hardware info)\nNicola Salmoria (MAME driver)\nTim Lindquist (color info)",
		dkongjr_machine_driver,
	
		dkjrjp_rom,
		null, null,
		null,
	
		input_ports, null, trak_ports, dsw, keys,
	
		dkongjr_color_prom, null, null,
		ORIENTATION_ROTATE_90,
	
		hiload, hisave
	);
	
	public static GameDriver dkjrbl_driver = new GameDriver
	(
		"Donkey Kong Jr. (bootleg)",
		"dkjrbl",
		"Gary Shepherdson (Kong emulator)\nBrad Thomas (hardware info)\nNicola Salmoria (MAME driver)\nTim Lindquist (color info)",
		dkongjr_machine_driver,
	
		dkjrbl_rom,
		null, null,
		null,
	
		input_ports, null, trak_ports, dsw, keys,
	
		dkongjr_color_prom, null, null,
		ORIENTATION_ROTATE_90,
	
		hiload, hisave
	);
	
	public static GameDriver dkong3_driver = new GameDriver
	(
		"Donkey Kong 3",
		"dkong3",
		"Mirko Buffoni (MAME driver)\nNicola Salmoria (additional code)\nTim Lindquist (color info)",
		dkong3_machine_driver,
	
		dkong3_rom,
		null, null,
		null,
	
		dkong3_input_ports, null, trak_ports, dkong3_dsw, keys,
	
		dkong3_color_prom, null, null,
		ORIENTATION_ROTATE_90,
	
		dkong3_hiload, dkong3_hisave
	);
	
	public static GameDriver hunchy_driver = new GameDriver
	(
		"Hunchback",
		"hunchy",
		"Nicola Salmoria (MAME driver)\nTim Lindquist (color info)",
		dkongjr_machine_driver,
	
		hunchy_rom,
		null, null,
		null,
	
		input_ports, null, trak_ports, dsw, keys,
	
		hunchy_color_prom, null, null,
		ORIENTATION_ROTATE_90,
	
		null, null
	);
}
